﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageLayout.Master" AutoEventWireup="true" CodeBehind="frmSobaodanh.aspx.cs" Inherits="BVVD_Website.ql_thi_sinh.frmSobaodanh" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
        <Windows>
            <telerik:RadWindow ID="rw_customConfirm" Modal="true" Behaviors="Close, Move" VisibleStatusbar="false"
                Width="300px" Height="200px"  Animation="Slide" AnimationDuration="300" CenterIfModal="true"  Overlay="true" runat="server">
                <ContentTemplate>
                    <div class="rwDialogPopup radconfirm" style="width:auto; height:auto">
                        <div class="rwDialogText">
                            <asp:Literal ID="confirmMessage" Text="" runat="server" />
                        </div>
                        <div>
                            <telerik:RadButton runat="server" ID="rbConfirm_OK" Text="OK" OnClick="rbConfirm_OK_Click">
                            </telerik:RadButton>
                            <telerik:RadButton runat="server" ID="rbConfirm_Cancel" Text="Cancel" OnClientClicked="closeCustomConfirm">
                            </telerik:RadButton>
                        </div>
                    </div>
                </ContentTemplate>
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <div id="Div1" class="mpBottomContent" runat="server">
        <asp:Label runat="server" ID="lblMenu" Style="margin: 0 auto 0 auto; font-family: 'Microsoft Sans Serif'; font-size: larger; color: forestgreen" Text="ĐÁNH SỐ BÁO DANH"></asp:Label>
        
        <table style="margin: 0 auto 0 auto; border: 5px thin red; width: 90% !important; padding: 5px 5px 5px 5px">
            <caption style="float: left">
                <table style="text-align: left">
                    <tr>
                        <td>
                            <asp:Label runat="server" Text="Chọn kỳ thi" ID="lblKYTHI"></asp:Label></td>
                        <td>
                            <telerik:RadDropDownList DefaultMessage="Chọn kỳ thi" DropDownHeight="200" Skin="Hay" OnSelectedIndexChanged="ddlKythi_SelectedIndexChanged" AutoPostBack="true" runat="server" ID="ddlKythi"></telerik:RadDropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label runat="server" Text="Tiền tố" ID="lblTIENTO"></asp:Label></td>
                        <td>
                            <telerik:RadTextBox runat="server" ID="txtTIENTO"></telerik:RadTextBox>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="txtTIENTO" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label runat="server" Text="Độ dài số báo danh" ID="lblDODAI"></asp:Label></td>
                        <td>
                            <telerik:RadNumericTextBox NumberFormat-DecimalDigits="0" Type="Number" ShowSpinButtons="true" MinValue="0" DataType="System.Int32" runat="server" ID="txtDODAI"></telerik:RadNumericTextBox>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="txtDODAI" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                </table>
            </caption>
            <tr>
                <td>
                    <telerik:RadGrid ID="grvSobaodanh" Skin="Hay" AllowFilteringByColumn="true" MasterTableView-NoMasterRecordsText="Không tìm thấy bản ghi nào" MasterTableView-ShowHeadersWhenNoRecords="true" ClientSettings-ColumnsReorderMethod="Reorder" ClientSettings-AllowColumnsReorder="true" ClientSettings-Animation-AllowColumnReorderAnimation="true" ClientSettings-Animation-ColumnReorderAnimationDuration="300" PageSize="15" AllowSorting="true" AutoGenerateColumns="false" AllowPaging="true" ClientSettings-AllowDragToGroup="true" OnItemCommand="grvSobaodanh_ItemCommand" OnNeedDataSource="grvSobaodanh_NeedDataSource" runat="server">

                        <PagerStyle Mode="NextPrevAndNumeric" PageSizeControlType="RadComboBox" Wrap="true" AlwaysVisible="true" />

                        <MasterTableView CommandItemDisplay="TopAndBottom" EnableNoRecordsTemplate="true" CssClass="MasterClass" ShowFooter="true" EditMode="PopUp" Summary="SUMMARY" ShowHeadersWhenNoRecords="true"
                            DataKeyNames="RECID">
                            <CommandItemSettings AddNewRecordText="Thêm mới" RefreshText="Làm mới danh sách" ExportToPdfText="Xuất file dạng PDF" ShowExportToPdfButton="true"></CommandItemSettings>
                            <CommandItemSettings ExportToExcelText="Xuất file dạng Excel" ShowExportToExcelButton="true"></CommandItemSettings>

                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

                            <CommandItemTemplate>
                                <div style="padding: 5px 5px; float: right">
                                    <telerik:RadButton ButtonType="LinkButton" Skin="Metro" BorderStyle="None" Text="Đánh số báo danh tự động" runat="server" OnClick="lbtnSetSBD_Click" ID="lbtnSetSBD">
                                        <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconRight="4" />
                                    </telerik:RadButton>
                                    &nbsp;&nbsp;
                                    <telerik:RadButton ButtonType="LinkButton" Skin="Metro" CausesValidation="true" BorderStyle="None" Text="Lưu" runat="server" ID="lbtnSave" CommandName="SavetoDB">
                                        <Icon PrimaryIconCssClass="rbSave" PrimaryIconLeft="4" PrimaryIconRight="4" />
                                    </telerik:RadButton>
                                    &nbsp;&nbsp; 
                                    <%--<telerik:RadButton ID="LinkButton2" Skin="Telerik" ButtonType="StandardButton" runat="server" CommandName="InitInsert" Text="Thêm mới" Visible='<%# !grvGiayChungnhan.MasterTableView.IsItemInserted %>'></telerik:RadButton>&nbsp;&nbsp; --%>
                                    <telerik:RadButton ID="LinkButton4" Skin="Metro" BorderStyle="None" ButtonType="LinkButton" runat="server" CommandName="RebindGrid" Text="Làm mới danh sách">
                                        <Icon PrimaryIconCssClass="rbRefresh" PrimaryIconLeft="4" PrimaryIconRight="4" />
                                    </telerik:RadButton>
                                </div>
                            </CommandItemTemplate>

                            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" Created="True"></ExpandCollapseColumn>
                            <NoRecordsTemplate>
                                <div>
                                    Không có bản ghi nào
                                </div>
                            </NoRecordsTemplate>
                            <Columns>

                                <telerik:GridBoundColumn UniqueName="RECID" EditFormColumnIndex="1" Display="false" ReadOnly="true" HeaderText="" DataField="RECID">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                    <HeaderStyle ForeColor="Silver" Width="20px"></HeaderStyle>
                                    <ItemStyle ForeColor="Gray"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="MAKT" Display="false" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Mã kỳ thi" DataField="MAKT">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="TENKT" Display="false" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Kỳ thi" DataField="TENKT">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="MATS" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Mã thí sinh" DataField="MATS">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="TENTS" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Thí sinh" DataField="TENTS">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="NGAYSINH" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="20%" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày sinh" DataField="NGAYSINH">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>


                                <telerik:GridBoundColumn UniqueName="CMND" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="CMND" DataField="CMND">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>


                                <telerik:GridBoundColumn UniqueName="DIACHI" ItemStyle-HorizontalAlign="Left" Display="true" HeaderStyle-Width="30%" HeaderText="Địa chỉ" DataField="DIACHI">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <%--<telerik:GridTemplateColumn UniqueName="SOBAODANH" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Số báo danh" DataField="SOBAODANH">
                                    <ItemTemplate>
                                        <telerik:RadTextBox runat="server" Skin="Telerik" ID="txtSOBAODANH" Text='<%# DataBinder.Eval(Container.DataItem,"SOBAODANH") %>'></telerik:RadTextBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>--%>

                                <telerik:GridBoundColumn UniqueName="SOBAODANH" ItemStyle-HorizontalAlign="Left" Display="true" HeaderStyle-Width="20%" HeaderText="Số báo danh" DataField="SOBAODANH">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>


                                <%--<telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" HeaderText="Xóa" ItemStyle-Width="60" HeaderStyle-Width="60" ConfirmDialogType="RadWindow" ConfirmTextFormatString="Bạn chắc chắn muốn xóa bản ghi : \n\n Số giấy chứng nhận : {0} <br>\t Mã lớp học : {1} <br> \n\t Mã học viên :  {2} \n " ConfirmTextFields="SOGCN,MALH, MAHV" ConfirmTitle="Xác nhận xóa" ConfirmText="Xóa, Hủy" Text="Xóa" UniqueName="btnDelete">
                                </telerik:GridButtonColumn>--%>
                            </Columns>
                            <EditFormSettings EditFormType="AutoGenerated" PopUpSettings-ScrollBars="Auto" PopUpSettings-ShowCaptionInEditForm="true" PopUpSettings-Width="600" PopUpSettings-ZIndex="4000" PopUpSettings-Modal="true" CaptionFormatString="Mã thí sinh {0}" CaptionDataField="MATS">
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings>
                            <ClientEvents OnPopUpShowing="PopUpShowing" />
                            <%--<ClientEvents OnRowDblClick="RowDblClick" />--%>
                            <Selecting AllowRowSelect="true" />
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                            <Animation AllowColumnReorderAnimation="true" ColumnReorderAnimationDuration="500" />

                        </ClientSettings>
                        <ExportSettings Excel-Format="Biff" Pdf-DefaultFontFamily="Arial" FileName="Mydata" IgnorePaging="false" Excel-AutoFitImages="true" Excel-FileExtension="xls" HideStructureColumns="true"></ExportSettings>
                    </telerik:RadGrid>
                </td>
            </tr>
        </table>
    </div>

    <telerik:RadNotification ID="rnAlert" runat="server" Width="300" Position="TopRight" EnableRoundedCorners="true"
        EnableShadow="true" Skin="Hay" Overlay="true" Animation="Fade" ContentScrolling="Auto" AnimationDuration="1000" Title="Thông báo">
    </telerik:RadNotification>
    <script type="text/javascript">
        function closeCustomConfirm() {
            $find("<%=rw_customConfirm.ClientID %>").close();
        }
    </script>
</asp:Content>
